﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<KLS.PPDS.Web.Models.UserViewModel>" %>
<%@ Import Namespace="KLS.PPDS.Resources" %>
<%@ Import Namespace="KLS.PPDS.Utility.Html" %>
<%@ Import Namespace="MvcContrib.UI.Grid" %>
<% Html.Grid(Model.UserList).Columns(column =>
                                              {
                                                  column.For(c => c.Id);
                                                  column.For(c => c.UserName).Named(CommonString.UserName);
                                                  column.For(c => c.UserFullName ?? "&nbsp").Named(CommonString.UserFullName).Encode(false);
                                                  column.For(c => c.Company == null ? "&nbsp" : c.Company.CompanyName.Wrap(20, " <br> ")).Named(CommonString.Company).Encode(false);
                                                  column.For(c => c.Language == null ? "&nbsp" : c.Language.Name).Named(CommonString.Language);
                                                  column.For(c => c.Role == null ? "&nbsp" : c.Role.RoleName).Named(CommonString.UserType);
                                                  column.For(c => c.PhoneNo == null ? "&nbsp" : c.PhoneNo.Wrap(20, " <br>")).Named(CommonString.PhoneNumber).Encode(false);
                                                  //column.For(c => Html.TextBox("Edit", "Edit", new { @type = "button", @onclick = string.Format("AjaxEditCallWithFormData('user/EditUser?userId={0}')", c.Id) })).Named("Edit");
                                                  //column.For(c => Html.TextBox("Delete", "Delete", new { @type = "button", @onclick = string.Format("AjaxDeleteCallWithFilter('user/DeleteUser?userId={0}')", c.Id) })).Named("Delete");

                                              }).RowAttributes(c => new Dictionary<string, object> { { "onClick", string.Format("AjaxEditCallWithFormData('user/EditUser?userId={0}')", c.Item.Id) } }).Render(); 
    %>